<?php
    $this->title = "Upload image";
    $this->headTitle($this->title);

    $allDisco = $this->allDisco;
    $zonaList = $this->zonaList;
?>
<?php
/**
 *  dispay all disco in  sponsor0
 */
$line = '<div id="box">';
foreach ($allDisco as $key=>$allDisco2){
    $line_new = '<h2><a href="'. $this->url(array('controller'=>'Club',
                                                  'name'=> $allDisco2[0],
                                                   ), 'locale', TRUE) .'">' . $allDisco2[1]
              . '</a></h2>';
    $line = $line . $line_new;
    }
$line = $line . '</div>';
$this->layout()->sponsor0 = $line;

/**
 * dispay all "provincia" in  provincia
 */
$line4 = '';
foreach ($zonaList as $key=>$zonaList2){
    $line4_new = '<h2><a href="'. $this->url(array('controller'=>'Index',
                                                    'action'=>'provincia',
                                                    'id'=> $zonaList2,
                                                   ), 'index', TRUE) .'">' . $zonaList2 . '</a></h2>';
    $line4 = $line4 . $line4_new;
    }
$line4 = $line4 . '';
$this->layout()->provincia = $line4;
?>
    <?php
        if ($this->isError==1){ // i got some error
           echo "<h3>Si è verificato un errore, prova di nuovo.</h3>";
           echo "<h5>$this->errormsg</h5>";
           echo "<pre>";
           print_r($this->errors);
           echo "</pre>";

           echo $this->form;
        } else{
            if ($this->messages==="yes"){
                echo "<h5>Immagine caricata con successo!</h5>";
                $piva = $this->piva;
                $name = $this->name;
                ?>
                <a href="<?=$this->url(array('controller' => 'Club', 'action' => 'upload-club-img','name'=>$name,'piva'=>$piva), 'club', true );?>">Carica un'altra immagine!</a><br />
         <? } else {
             echo "<h3>Si è verificato un errore, prova di nuovo.</h3>";
             print_r($this->messages);
             print_r($this->errors);
         }
        }

        if ($this->isError==2){
            print_r($this->messages);
            print_r($this->errors);
        }
    ?>
    <br />
    <a href="<?=$this->url(array('controller' => 'admin', 'action' => 'index'), 'admin', true );?>"><- Pannello di amministrazione.</a><br />